--[[------------------------------------------------------------------------------------------------------------------ Smart terrain binder Нужен для того, чтобы серверный объект smart terrain получал обновления. Чугай Александр --------------------------------------------------------------------------------------------------------------------]] function bind( obj ) local ini = obj:spawn_ini() if not ini then return end if ini:section_exist( "gulag1" ) or ini:section_exist( "smart_terrain" ) then if obj:clsid() == clsid.smart_terrain then if alife() then obj:bind_object( smart_terrain_binder( obj ) ) else printf( "No simulation! SMART_TERRAIN '%s' disabled.", obj:name() ) end else abort( "You must use SMART_TERRAIN instead of SCRIPT_ZONE %s", obj:name() ) end end end ---------------------------------------------------------------------------------------------------------------------- class "smart_terrain_binder" ( object_binder ) function smart_terrain_binder:__init( obj ) super( obj ) end function smart_terrain_binder:net_spawn( se_abstract ) if not object_binder.net_spawn( self, se_abstract ) then return false end -- получить ссылку на настоящий серверный объект self.se_smart_terrain = alife_object( se_abstract.id ) db.add_zone( self.object ) return true end function smart_terrain_binder:net_destroy() xr_sound.stop_sounds_by_id(self.object:id()) db.del_zone( self.object ) object_binder.net_destroy( self ) end function smart_terrain_binder:net_Relcase( obj ) end function smart_terrain_binder:update( delta ) object_binder.update( self, delta ) if (self.se_smart_terrain) then self.se_smart_terrain:update() end end